package com.ffapp.rainmonitorcustom.bean;

import android.text.TextUtils;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * Created by otis on 2018/4/23.
 */

public class ProjectInfoBean extends BasisBean {

    /**
     * all_token : null
     * surplus_token : null
     * quota_token : null
     * total_token : null
     * token_price : null
     * service_charge : null
     * project_id : 57
     * is_need_whitelist : 0
     * into_token : null
     * surplus : null
     */

    private String unjoin_country;
    private String how_join;
    private String purchase_notes;
    private List<String> imgs = new ArrayList<>();
    private String surplus;
    private String project_hard_top;
    private String receivable_qrcode;
    private String suocang_rules;
    private String into_token;
    private int status;
    private String project_team;
    private String wechat_head;
    private String notes;
    private String label;
    private String token_price;
    private String purchase_start_time;
    private String private_placement;
    private String total_token;
    private String service_charge;
    private String token_name;
    private String public_placement;
    private String project_soft_item;
    private String join_type;
    private String receivable_address;
    private String surplus_token;
    private String purchase_end_time;
    private String token_start_time;
    private String introduction;
    private String exchange_time;
    private String accept_token;
    private String quota_token;
    private String wechat_customer;
    private String subscription_ratio;
    private String all_token;
    private String hot_status;
    private String white_paper;
    private String web_address;
    private String private_placement_info;
    private String public_placement_info;
    //项目额度单位
    private String total_token_unit;
    private int is_like;
    private int is_need_whitelist;
    private String project_id;
    //项目认购开始时间
    private String platform_start_time;
    //项目认购结束时间
    private String platform_end_time;
    private String credit_limit;
    private String no_reach_credit;
    private String no_reach_credit_msg;



    public int getIs_need_whitelist() {
        return is_need_whitelist;
    }
    public String getIs_need_whitelistStr() {
        return  is_need_whitelist == 1 ?"是":"否";
    }

    public void setIs_need_whitelist(int is_need_whitelist) {
        this.is_need_whitelist = is_need_whitelist;
    }

    public void setUnjoin_country(String unjoin_country) {
        this.unjoin_country = unjoin_country;
    }
    public String getUnjoin_country() {
        return unjoin_country;
    }

    public void setHow_join(String how_join) {
        this.how_join = how_join;
    }
    public String getHow_join() {
        return how_join;
    }

    public void setPurchase_notes(String purchase_notes) {
        this.purchase_notes = purchase_notes;
    }
    public String getPurchase_notes() {
        return purchase_notes;
    }

    public void setImgs(List<String> imgs) {
        this.imgs = imgs;
    }
    public List<String> getImgs() {
        if(imgs != null && imgs.size() >0 &&  TextUtils.isEmpty(imgs.get(0))){
            imgs = new ArrayList<String>();
        }
        return imgs;
    }
    public ArrayList<String> getImgsArraylist() {
        if(imgs != null && imgs.size() >0 &&  TextUtils.isEmpty(imgs.get(0))){
            imgs = new ArrayList<String>();
        }
        return (ArrayList<String>) imgs;
    }

    public void setSurplus(String surplus) {
        this.surplus = surplus;
    }
    public String getSurplus() {
        return surplus;
    }
    public boolean getSurplusEmptyBoolean() {
        if(TextUtils.isEmpty(surplus))return true;
        return false;
    }
    public boolean getSurplusZeroBoolean() {
        if(TextUtils.isEmpty(surplus))return true;
        if(surplus.equals("0"))return true;
        if(surplus.equals("0.00"))return true;
        return false;
    }

    public void setProject_hard_top(String project_hard_top) {
        this.project_hard_top = project_hard_top;
    }
    public String getProject_hard_top() {
        return project_hard_top;
    }

    public void setReceivable_qrcode(String receivable_qrcode) {
        this.receivable_qrcode = receivable_qrcode;
    }
    public String getReceivable_qrcode() {
        return receivable_qrcode;
    }

    public void setSuocang_rules(String suocang_rules) {
        this.suocang_rules = suocang_rules;
    }
    public String getSuocang_rules() {
        return suocang_rules;
    }

    public void setInto_token(String into_token) {
        this.into_token = into_token;
    }
    public String getInto_token() {
        if(TextUtils.isEmpty(into_token))return "";
        return into_token;
    }

    public void setStatus(int status) {
        this.status = status;
    }
    public int getStatus() {
        return status;
    }

    public void setProject_team(String project_team) {
        this.project_team = project_team;
    }
    public String getProject_team() {
        return project_team;
    }

    public void setWechat_head(String wechat_head) {
        this.wechat_head = wechat_head;
    }
    public String getWechat_head() {
        return wechat_head;
    }

    public void setNotes(String notes) {
        this.notes = notes;
    }
    public String getNotes() {
        return notes;
    }

    public void setLabel(String label) {
        this.label = label;
    }
    public String getLabel() {
        return label;
    }

    public void setToken_price(String token_price) {
        this.token_price = token_price;
    }
    public String getToken_price() {
        return token_price;
    }

    public void setPurchase_start_time(String purchase_start_time) {
        this.purchase_start_time = purchase_start_time;
    }
    public String getPurchase_start_time() {
        return purchase_start_time;
    }

    public void setPrivate_placement(String private_placement) {
        this.private_placement = private_placement;
    }
    public String getPrivate_placement() {
        return private_placement;
    }

    public void setTotal_token(String total_token) {
        this.total_token = total_token;
    }
    public String getTotal_token() {
        return total_token;
    }

    public void setService_charge(String service_charge) {
        this.service_charge = service_charge;
    }
    public String getService_charge() {
        return service_charge;
    }

    public void setToken_name(String token_name) {
        this.token_name = token_name;
    }
    public String getToken_name() {
        return token_name;
    }

    public void setPublic_placement(String public_placement) {
        this.public_placement = public_placement;
    }
    public String getPublic_placement() {
        return public_placement;
    }

    public void setProject_soft_item(String project_soft_item) {
        this.project_soft_item = project_soft_item;
    }
    public String getProject_soft_item() {
        return project_soft_item;
    }

    public void setJoin_type(String join_type) {
        this.join_type = join_type;
    }
    public String getJoin_type() {
        return join_type;
    }

    public void setReceivable_address(String receivable_address) {
        this.receivable_address = receivable_address;
    }
    public String getReceivable_address() {
        return receivable_address;
    }

    public void setSurplus_token(String surplus_token) {
        this.surplus_token = surplus_token;
    }
    public String getSurplus_token() {
        return surplus_token;
    }

    public void setPurchase_end_time(String purchase_end_time) {
        this.purchase_end_time = purchase_end_time;
    }
    public String getPurchase_end_time() {
        return purchase_end_time;
    }

    public void setToken_start_time(String token_start_time) {
        this.token_start_time = token_start_time;
    }
    public String getToken_start_time() {
        return token_start_time;
    }
    public String getWhite_paper() {
        return white_paper;
    }

    public void setWhite_paper(String white_paper) {
        this.white_paper = white_paper;
    }

    public String getWeb_address() {
        return web_address;
    }

    public void setWeb_address(String web_address) {
        this.web_address = web_address;
    }

    public void setIntroduction(String introduction) {
        this.introduction = introduction;
    }
    public String getIntroduction() {
        return introduction;
    }

    public void setExchange_time(String exchange_time) {
        this.exchange_time = exchange_time;
    }
    public String getExchange_time() {
        return exchange_time;
    }

    public void setAccept_token(String accept_token) {
        this.accept_token = accept_token;
    }
    public String getAccept_token() {
        return accept_token;
    }

    public void setQuota_token(String quota_token) {
        this.quota_token = quota_token;
    }
    public String getQuota_token() {
        return quota_token;
    }

    public void setWechat_customer(String wechat_customer) {
        this.wechat_customer = wechat_customer;
    }
    public String getWechat_customer() {
        return wechat_customer;
    }

    public void setSubscription_ratio(String subscription_ratio) {
        this.subscription_ratio = subscription_ratio;
    }
    public String getSubscription_ratio() {
        return subscription_ratio;
    }

    public void setAll_token(String all_token) {
        this.all_token = all_token;
    }
    public String getAll_token() {
        return all_token;
    }

    public int getIs_like() {
        return is_like;
    }
    public boolean getIs_likeBoolean() {
        return is_like == 1;
    }

    public void setIs_like(int is_like) {
        this.is_like = is_like;
    }
    public void changeLike(){
      setIs_like(getIs_likeBoolean()?0:1);
    }

    public String getHot_status() {
        return hot_status;
    }

    public boolean isHot(){
        if(TextUtils.isEmpty(hot_status))return false;
        return  hot_status.equals("hot");
    }

    public void setHot_status(String hot_status) {
        this.hot_status = hot_status;
    }

    public String getTotal_token_unit() {
        if(TextUtils.isEmpty(total_token_unit))return "";
        return total_token_unit;
    }

    public void setTotal_token_unit(String total_token_unit) {
        this.total_token_unit = total_token_unit;
    }

    public String getPrivate_placement_info() {
        if(TextUtils.isEmpty(private_placement_info))return "";
        return private_placement_info;
    }

    public void setPrivate_placement_info(String private_placement_info) {
        this.private_placement_info = private_placement_info;
    }

    public String getPublic_placement_info() {
        if(TextUtils.isEmpty(public_placement_info))return "";
        return public_placement_info;
    }

    public void setPublic_placement_info(String public_placement_info) {
        this.public_placement_info = public_placement_info;
    }

    public String getProject_id() {
        return project_id;
    }

    public void setProject_id(String project_id) {
        this.project_id = project_id;
    }

    public String getPlatform_start_time() {
        return platform_start_time;
    }

    public void setPlatform_start_time(String platform_start_time) {
        this.platform_start_time = platform_start_time;
    }

    public String getPlatform_end_time() {
        return platform_end_time;
    }

    public void setPlatform_end_time(String platform_end_time) {
        this.platform_end_time = platform_end_time;
    }

    public boolean isShowBuy(){
        if(isEmpty(platform_start_time) || isEmpty(platform_end_time))return false;

        long starttime = Long.valueOf(platform_start_time)*1000;
        long endtime = Long.valueOf(platform_end_time)*1000;

        long timenow = new Date().getTime();
        if(timenow < starttime){
            return false;
        }else if(timenow > starttime && timenow < endtime){
            return true;
        }else{
            return false;
        }

    }

    public long getLeftTime(){
        if(TextUtils.isEmpty(platform_end_time))return 0;
        return  Long.valueOf(platform_end_time)*1000-new Date().getTime();
    }

    public String getCredit_limit() {
        return credit_limit;
    }

    public void setCredit_limit(String credit_limit) {
        this.credit_limit = credit_limit;
    }

    public String getNo_reach_credit() {
        return no_reach_credit;
    }
    public boolean isCreditEnoughBoolean() {
        return no_reach_credit.equals("0");
    }

    public void setNo_reach_credit(String no_reach_credit) {
        this.no_reach_credit = no_reach_credit;
    }

    public String getNo_reach_credit_msg() {
        return no_reach_credit_msg;
    }

    public void setNo_reach_credit_msg(String no_reach_credit_msg) {
        this.no_reach_credit_msg = no_reach_credit_msg;
    }
}
